package com.joysuch.wwyt.bp.entity.inspect;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 巡检-检查记录
 */
@Data
@Entity
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Table(name = "WWYT_BP_INSPECT_RECORD_DETAIL")
@SQLDelete(sql = "update WWYT_BP_INSPECT_RECORD_DETAIL set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_INSPECT_RECORD_DETAIL set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class BpInspectRecordDetail implements Serializable {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("检查记录ID")
    private Long inspectRecordId;

    @ApiModelProperty("检查计划ID")
    private Long inspectPlanId;

    @ApiModelProperty("检查点ID")
    private Long inspectPointId;

    @ApiModelProperty("检查设备ID")
    private Long inspectDeviceId;

    @ApiModelProperty("检查项目")
    private String inspectItem;

    @ApiModelProperty("检查标准")
    private String inspectStandard;

    @ApiModelProperty("检查结果")
    private String inspectResult;

    @ApiModelProperty("检查结果状态")
    private String inspectResultStatus;

    @ApiModelProperty("检查点设备照片json串")
    private String inspectDevicePicture;

    @ApiModelProperty("整改状态")
    private String repairStatus;


    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    private Long createBy;

    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    private java.time.LocalDateTime createTime;

    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    private java.time.LocalDateTime updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
